import 'package:flutter/material.dart';

import 'package:get/get.dart';

import '../controllers/register_step_three_controller.dart';
import '../../../../common/widget/logo.dart';
import '../../../../utils/screenAdapter.dart';
import '../../../../common/widget/passTextField.dart';
import '../../../../common/widget/codeButton.dart';

class RegisterStepThreeView extends GetView<RegisterStepThreeController> {
  const RegisterStepThreeView({super.key});
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: PreferredSize(
        preferredSize: Size.fromHeight(ScreenAdapter.height(140)),
        child: Padding(
          padding: EdgeInsets.only(
            top: ScreenAdapter.height(70),
            left: ScreenAdapter.width(10),
          ),
          child: Row(
            crossAxisAlignment: CrossAxisAlignment.center,
            children: [
              IconButton(
                onPressed: () {
                  Get.back();
                },
                icon: Icon(
                  Icons.arrow_back_rounded,
                  size: ScreenAdapter.fontSize(60),
                ),
              ),
              SizedBox(width: ScreenAdapter.width(40)),
              Text(
                "手机号快速注册",
                style: TextStyle(
                  fontSize: ScreenAdapter.fontSize(40),
                  fontWeight: FontWeight.bold,
                ),
              ),
              SizedBox(width: ScreenAdapter.width(500)),
              Text(
                "帮助",
                style: TextStyle(
                  color: Colors.black54,
                ),
              ),
            ],
          ),
        ),
      ),
      backgroundColor: Colors.white,
      body: ListView(
        padding: EdgeInsets.fromLTRB(
          ScreenAdapter.width(30),
          ScreenAdapter.height(60),
          ScreenAdapter.width(30),
          ScreenAdapter.height(30),
        ),
        children: [
          Logo(),
          SizedBox(height: ScreenAdapter.height(160)),
          PassTextField(
            controller: controller.passwordController,
            hasBorder: true,
            hintText: "请输入密码",
            passwordInput: true,
            onChanged: (value) {
              print("手机号码: $value");
            },
          ),
          SizedBox(height: ScreenAdapter.height(50)),
          PassTextField(
            hasBorder: true,
            controller: controller.confirmPasswordController,
            hintText: "请输入确认密码",
            passwordInput: true, 
            onChanged: (value) {
              print("手机号码: $value");
            },
          ),
          SizedBox(height: ScreenAdapter.height(170)),
          CodeButton(
            textContent: "完成注册",
            onPressed: () {
             controller.goRegister();
            },
          ),
          SizedBox(height: ScreenAdapter.height(40)),
          Row(
            mainAxisAlignment: MainAxisAlignment.center,
            children: [
              Text("遇到问题？您可以", style: TextStyle(color: Colors.black54)),
              Text('获取帮助', style: TextStyle(color: Colors.blue)),
            ],
          ),
        ],
      ),
    );
  }
}
